﻿using PetaPoco;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Web;
using System.Web.Http;

namespace MettingOrder.Controllers
{
    public class BaseApiController : ApiController
    {
        private Database _db;
        public Database db
        {
            get
            {
                _db = CallContext.GetData("db") as Database;
                if (_db == null)
                {
                    _db = new Database("mettingOrder");
                    CallContext.SetData("db", _db);
                }
                return _db;
            }
        }
    }
}